package org.example.controller;

import lombok.extern.slf4j.Slf4j;
import org.codehaus.jettison.json.JSONObject;
import org.example.pojo.ClazzOption;
import org.example.pojo.JobOption;
import org.example.pojo.Result;
import org.example.service.imp.ReportServiceImp;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/report")
public class ReportController {
    @Autowired
    private ReportServiceImp reportServiceImp;
    /**
     * 获取员工工资报表数据
     * @return
     */
    @GetMapping("/empJobData")
    public Result getEmpReportData() {
        log.info("获取员工职位报表数据");
         JobOption jobOption  =   reportServiceImp.getEmpJobData();
         return Result.success(jobOption);
    }
//   /**
//    @GetMapping("/empGenderData")
//    public Result getEmpGenderData() {
//        log.info("获取员工性别报表数据");
//        List<Map<String, Object>> genderList = reportServiceImp.getEmpGenderData();
//        return Result.success(genderList);
//    }
    @GetMapping("/empGenderData")
    public Result getEmpGenderData() {
        log.info("获取员工性别报表数据");
        List<Map<String, Object>> genderList = reportServiceImp.getEmpGenderData();
        return Result.success(genderList);
    }
    /**
     * 获取学生学历报表数据
     */
    @GetMapping("/studentDegreeData")
    public Result getStudentDegreeData() {
        log.info("获取学生学历报表数据");
        List<Map<String, Object>> degreeList = reportServiceImp.getStudentDegreeData();
        return Result.success(degreeList);
    }
    /**
     * 班级人数报表
     */
    @GetMapping("/studentCountData")

    public Result getStudentCountData() {
        log.info("班级人数报表");
        ClazzOption countList =  reportServiceImp.getStudentCountData();
        return Result.success(countList);
    }


}
